TOP       ?= ../..
PRJ_TOP   ?= ../../../..
SRC_TOP   ?= ${PRJ_TOP}/src
TREND_TOP ?= ${SRC_TOP}/trend
PREFIX    ?= ${PRJ_TOP}/output/root


-include $(SRC_TOP)/build.conf
-include $(SRC_TOP)/cross.conf

ARCH := i386

ifeq ("$(ARCH)", "i386")
        FLAG_M32=-m32
else
        FLAG_M32=
endif

BINS := tmSNMPQuery
SRCS := tmSNMPQuery.cpp

OBJS := $(addsuffix .o, $(basename ${SRCS}))

CFLAGS  = $(FLAG_M32) -Wall -g3 -I$(TREND_TOP)/utils/glcfg
LDFLAGS = $(FLAG_M32) -L$(TREND_TOP)/utils/glcfg/bin/$(ARCH) -lglcfg -ldl

all: build L10N

build:  ${BINS}

${BINS}:
	$(CXX) -o $@ $^ $(LDFLAGS)

.c.o: %.c
	${CC} -o $@ -c $< ${CFLAGS}

.cpp.o: %.cpp
	${CXX} -o $@ -c $< ${CFLAGS}

L10N:

install:
	for bin in ${BINS}; do \
                install -m 755 $$bin $(PREFIX)/opt/TrendMicro/$(PRJNAME)/bin/; \
        done

clean:
	${RM} ${BINS} ${OBJS}

#dependencies
tmSNMPQuery: tmSNMPQuery.o 

